﻿<UserControl 
    x:Class="Microsoft.Samples.WindowsPhoneCloud.Phone.PivotContent.SqlSampleDataPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DataContext="{d:DesignData ../DesignData/SqlSamplaDataPageViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <ListBox x:Name="ItemsListBox" Grid.Row="0" ItemsSource="{Binding Items}" Visibility="{Binding HasResults, Converter={StaticResource VisibilityConverter}}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="0,0,0,17" Width="432">
                            <TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Id: " Width="120" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" />
                                <TextBlock Text="{Binding Id}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Date: " Width="120" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" />
                                <TextBlock Text="{Binding Date, Converter={StaticResource DateConverter}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Is Public: " Width="120" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" />
                                <TextBlock Text="{Binding IsPublic}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" />
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <StackPanel Grid.Row="2" Margin="12,0,12,12" Orientation="Vertical" VerticalAlignment="Bottom">
                <TextBlock HorizontalAlignment="Left" Text="{Binding Message}" TextWrapping="Wrap" />
                <ProgressBar Height="20" IsIndeterminate="True" Visibility="{Binding IsListing, Converter={StaticResource VisibilityConverter}}" />
            </StackPanel>
        </Grid>
    </Grid>

</UserControl>
